Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Port implementation of SimplexToOrderedTransform from numpyro #3320

Merged
merged 2 commits into from
Feb 7, 2024

Conversation

peblair
Copy link
Contributor

@peblair peblair commented Feb 4, 2024

This pull request adds support to Pyro for SimplexToOrderedTransform. The implementation used is a port of the numpyro implementation of the same class.

I was working on implementing a model based on this numpyro guide using Pyro, and this was the one thing which was necessary to reimplement.

Because this class is meant to be used on values greater than zero, I have additionally added the ability to specify the family of distribution which should be used in the transformation tests; this new transformation uses a Dirichlet distribution for its tests.

Copy link
Member

@fritzo fritzo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Looks great, thanks for porting this! I'll take a closer review of the math on second pass.

Thanks for adding tests and a docstring!

Could you also register this in docs/source/distributions.rst in the Transforms section? We try to keep that section alphabetical. I usually make docs and check that the new class does show up in the generated docs.

pyro/distributions/transforms/simplex_to_ordered.py Outdated Show resolved Hide resolved
pyro/distributions/transforms/simplex_to_ordered.py Outdated Show resolved Hide resolved
pyro/distributions/transforms/simplex_to_ordered.py Outdated Show resolved Hide resolved
@peblair peblair requested a review from fritzo February 5, 2024 07:45
@peblair
Copy link
Contributor Author

peblair commented Feb 6, 2024

@fritzo Thanks for giving this a look! The issues you flagged should be fixed now. Let me know if there's anything else this needs.

Copy link
Member

@fritzo fritzo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, thanks for making the changes.

@fritzo fritzo added this to the 1.9 release milestone Feb 7, 2024
@fritzo fritzo merged commit a52338c into pyro-ppl:dev Feb 7, 2024
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants